1. Field of the Invention
The present invention relates to an image processing apparatus. Particularly, the invention relates to an image processing apparatus, an image processing method, and an image processing program for performing image processes such as a defocus process and also to a recording medium having such an image processing program recorded therein.
2. Description of the Related Art
As a result of recent spread of digital cameras, various types of digital image processing are performed on still images photographed using digital cameras. A defocus process is one of such processes. A defocus process is a process of varying the amount of defocus imparted to a still image.
According to a technique used for a defocus process, when a pixel to be focused is selected in a still image, the amount of defocus imparted to each pixel of the still image is uniquely made different from others such that a region associated the pixel of interest will be focused. According to this technique, a plurality of still images of the same scene are obtained at respective focal distances, and three-dimensional distances are calculated based on the plurality of still images to impart different amounts of defocus (for example, see JP-A-2003-141506 (Patent Document 1)).
However, the approach necessitates a plurality of still images acquired at different focal distances, and it has not been possible to perform a defocus process using only one still image.
According to a technique proposed to cope with such a problem, when a display unit displaying one still image is touched, a defocus process is performed according to a depth map of the still image such that a region associated with the pixel in the touched position (hereinafter referred to as “pixel of interest”). For example, see JP-A-2009-15828 (Patent Document 2). A depth map is a collection of distance data representing distances between a lens and an object (hereinafter referred to as “lens-object distances”). The data are associated with each pixel group formed by a plurality of pixels forming a still image obtained by photographing the object. Alternatively, the data are associated with each pixel of the still image.
Therefore, a lens-object distance can be identified by referring to the distance data of a depth map.
FIG. 14 is an illustration of a still image displayed on a display unit.
A still image 702 is an image showing an object 703 which is a dog and an object 704 which is a cat located near the dog.
FIG. 15 is an illustration showing a relationship between the positions that an imaging lens 706 and the objects 703 and 704 assumed when the still image 702 was photographed (when the image was acquired).
As shown in FIG. 15, the object 703 is located closer to the imaging lens 706 than the object 704 is. The object 704 is located further from the imaging lens 706 than the object 703 is. That is, the lens-object distances of the region associated with pixels forming the object 703 are smaller than the lens-object distances of the region associated with pixels forming the object 704.
FIG. 16 is a distribution graph representing a depth map of regions associated with pixels of the still image 1102 shown in FIG. 14 located in positions indicated by the horizontal broken line.
In FIG. 16, lens-object distances indicated by distance data of regions associated with pixels of the image are shown along the vertical axis, and pixel numbers associated to the pixels are shown along the horizontal axis.
A pixel numbered “711” associated with a position 707 constituting the nose of the object 703 on the left end thereof has the smallest lens-object distance. A pixel numbered “712” associated with a position 708 constituting the right end of a swimming ring that the object 704 wears has the greatest lens-object distance. Although the pixel numbered “711” (hereinafter referred to as “nose pixel”) and the pixel numbered “712” (hereinafter referred to as “swim ring pixel”) are pixels located close to each other, there is a significant difference between the lens-object distances of the pixels.
FIG. 17 is an illustration showing how a user selects a pixel of interest from the still image 702 illustrated in FIGS. 14 to 16.
When the user wishes to select the nose pixel as a pixel of interest, the user touches the region of the nose in the still image 702 with a finger 705. At this time, if the nose pixel is accurately touched, the nose pixel is selected as a pixel of interest, and a defocus process is performed such that a region associated with the nose pixel will be focused.